{% extends 'base.html' %}
{% block order_2 %}

		<div class="col-md-8 column">
			<nav class="navbar navbar-default" role="navigation">
				<div class="navbar-header">
					 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#"><span class="glyphicon glyphicon-bookmark"></span>&nbsp;订单详情</a>
				</div>
			<table class="table">
						<thead>
							<tr>
								<th>
									品名
								</th>
								<th>
									单价(元)
								</th>
                                <th>
									数量
								</th>
							</tr>
						</thead>
						<tbody>
                        {% for foo in order_2_all %}
							<tr>
								<td>
									{{ foo.Order_food }}
								</td>
								<td>
									{{ foo.food_money }}元
								</td>
								<td>
									&nbsp;{{ foo.Order_num }}
								</td>
							</tr>
                        {% endfor %}
						</tbody>
                        <tbody>
                            <tr>
                                <td>
									<b>下单日期：{{ Order_data }}</b>
								</td>
                                <td>
									<b>合计金额：{{ order_money_all }}元</b>
								</td>
							</tr>
                        </tbody>
			</table>
		</div>
		<div class="col-md-4 column">
			<nav class="navbar navbar-default" role="navigation">
				<div class="navbar-header">
					 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#"><span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;评论</a>
				</div>
                {% if comment %}
                    <table class="table">
						<tbody>
                        {% for foo in comment %}
							<tr>
								<td style="word-break: break-all; word-wrap:break-word;">
									<b>评论内容:&nbsp;</b><br>{{ foo.comment }}
								</td>
                            </tr>
                            <tr>
								<td>
                                <b>美食照:&nbsp;</b>
                                    {% if foo.photo %}
                                        <img src="{{ foo.photo.url }}" width="100%">
                                    {% endif %}
								</td>
                            </tr>
                            <tr>
								<td>
									&nbsp;<b>星级:&nbsp;</b>
                                    {% if foo.lv == 1 %}
									    <span class="glyphicon glyphicon-star">&emsp;非常差</span>
                                    {% elif foo.lv == 2 %}
                                        <span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star">&emsp;差</span>
                                    {% elif foo.lv == 3 %}
                                        <span class="glyphicon glyphicon-star"><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span>&emsp;一般</span>
                                    {% elif foo.lv == 4 %}
                                        <span class="glyphicon glyphicon-star"><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span>&emsp;满意</span>
                                    {% else %}
                                        <span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star">&emsp;非常满意</span>
									{% endif %}
								</td>
							</tr>
                        {% endfor %}
						</tbody>
                        <tbody>
                            <tr>
                                <td>
									<a href="/order/"><button type="button" class="btn btn-default btn-block"><span class="glyphicon glyphicon-share-alt"></span>&nbsp;返回订单</button></a>
								</td>
							</tr>
                        </tbody>
			</table>

                {% else %}
			<form role="form" action="/order/order_all/" method="post" enctype="multipart/form-data">
                <input name="orderid" value="{{ orderid }}" hidden="hidden">
				<div class="form-group">
                    <textarea name="comment" style="height: 100px" class="form-control" placeholder="请在这里输入您对本次服务的评价..."></textarea>
				</div>
				<div class="form-group">
					 <label for="exampleInputFile">&emsp;美食照:</label>
                    <input name="photo" type="file" id="exampleInputFile" />
				</div>
				<div class="checkbox">
                    <b>&emsp;星级评分 :</b><br>
					 <label><input value="1" type="radio" name="lv" /><span class="glyphicon glyphicon-star">&emsp;非常差</span></label><br>
					 <label><input value="2" type="radio" name="lv" /><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star">&emsp;差</span></label><br>
					 <label><input value="3" type="radio" name="lv" /><span class="glyphicon glyphicon-star"><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span>&emsp;一般</span></label><br>
					 <label><input value="4" type="radio" name="lv" /><span class="glyphicon glyphicon-star"><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span>&emsp;满意</span></label><br>
					 <label><input value="5" type="radio" name="lv" /><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star">&emsp;非常满意</span></label>
				</div>
                <button type="submit" class="btn btn-success btn-block"><span class="glyphicon glyphicon-ok"></span>&nbsp;提交评价</button>
                &nbsp;
                <a href="/order/"><button type="button" class="btn btn-default btn-block"><span class="glyphicon glyphicon-share-alt"></span>&nbsp;返回订单</button></a>
                <br>
			</form>
                {% endif %}
		</div>
{% endblock order_2 %}